extends Item
func init():
	type = config.EQUITYPE_EQUI
	attInit()
	att.atk = 45
	att.mgiPenL = 0.1
	name = "[color=yellow]聚能法石[/color]"
	info = "[color=yellow]<法师利器>\n[/color][color=red]造成魔法伤害时，额外附加33%当前伤害的真实伤害[cd:3秒][/color]"
var cnt = 0
var flag = 0
func _connect():
	masCha.connect("onBattleStart",self,"run1")
	masCha.connect("onAtkChara",self,"run")
func run1():
	cnt = 0
	flag = 0
func _upS():
	._upS()
	#if sys.test:
	#	print(cnt)
	if flag:
		cnt += 1
		if cnt % 3 == 0:
			flag = 0
			cnt = 0
func run(atkinfo):
	if atkinfo.atkType == Chara.AtkType.EFF || atkinfo.hurtType != Chara.HurtType.MGI || flag:return
	masCha.hurtChara(atkinfo.hitCha,atkinfo.hurtVal * 0.33,Chara.HurtType.REAL,Chara.AtkType.EFF)
	flag = 1
	#.run(atkinfo)